﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Configuration;
using System.IO;
using System.Reflection;
using System.Xml;
using BackupAssurance.Library.DBEF;
using BackupAssurance.Library.Events;
using BackupAssurance.Library.Interfaces;
using BackupAssurance.Library.MEF;
using BackupAssurance.Library.ModelsDB;
using BackupAssurance.Library.Constants;
using System.Net.Mail;
using System.Collections.Specialized;

namespace BackupAssurance
{
    public partial class BackupAssuranceSvc : ServiceBase
    {
        QuickRun objRun;

        public BackupAssuranceSvc()
        {
            InitializeComponent();
            
        }

        //
        // Summary:
        //     When implemented in a derived class, executes when a Start command is sent
        //     to the service by the Service Control Manager (SCM) or when the operating
        //     system starts (for a service that starts automatically). Specifies actions
        //     to take when the service starts.
        //
        // Parameters:
        //   args:
        //     Data passed by the start command.
        protected override void OnStart(string[] args)

        {
            base.OnStart(args);

            objRun = new QuickRun();
            objRun.OnStart();
        }
        //
        // Summary:
        //     When implemented in a derived class, executes when a Stop command is sent
        //     to the service by the Service Control Manager (SCM). Specifies actions to
        //     take when a service stops running.
        protected override void OnStop()
        {
            base.OnStop();

            objRun.OnStop();
            objRun = null;
        }


    }
}
